//
//  ActivityPlusTableViewCell.m
//  我的小汽车
//
//  Created by mill on 15/1/4.
//  Copyright (c) 2015年 蓝欧科技. All rights reserved.
//

#import "ActivityPlusTableViewCell.h"

@implementation ActivityPlusTableViewCell

- (void)dealloc
{
    [_activityType release];
    [_collection release];
    [_interested release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.contentView.backgroundColor = [UIColor clearColor];
       
        self.activityType = [[UILabel alloc] init];
        [self.contentView addSubview:_activityType];
        [_activityType release];
        
        
        self.interested = [[UILabel alloc] initWithFrame:CGRectMake(11 + self.frame.size.width/ 5 * 2, 0, self.frame.size.width / 6, 25)];

        _interested.textColor = [UIColor colorWithRed:17.0/255.0 green:190.0/255.0 blue:227.0/255.0 alpha:1.0];;
        [self.contentView addSubview:_interested];
        [_interested release];
  
        self.inter =[[UILabel alloc] initWithFrame:CGRectMake(self.frame.size.width / 5 * 3, 0, self.frame.size.width/ 5, 25)] ;
        _inter.text = @"人感兴趣";
        [self.contentView addSubview:_inter];
        [_inter release];
      
        self.collection = [[UIButton alloc] init];
      
       
        [_collection setBackgroundImage:[UIImage imageNamed:@"night"] forState:UIControlStateNormal];
        [self.contentView addSubview:_collection];
        [_collection release];
        [self.contentView addSubview:_collection];
        [_collection release];
        
        
        
        self.cellView = [[UIView alloc] initWithFrame:CGRectMake(0, _collection.frame.size.height, self.frame.size.width, 20)];
        _cellView.backgroundColor = [UIColor lightGrayColor];
        [self.contentView addSubview:_cellView];
        [_cellView release];
    }
    return self;
}

//- (void)NotificationCenter
//{
//    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeNightOrDay:) name:@"changeState" object:nil];
//}
//
//- (void)changeNightOrDay:(NSNotification *)notification
//{
//    NSString *str = [notification.userInfo objectForKey:@"STATE"];
//    if ([str isEqualToString:@"CHANGETONIGHT"]) {
//        
//        self.inter.textColor = [UIColor whiteColor];
//    }
//    else
//    {
//         self.inter.textColor = [UIColor blackColor];
//    }
//}
//

-(void)layoutSubviews
{
    [super layoutSubviews];
    self.activityType.frame = CGRectMake(10, 0, self.frame.size.width/ 6 * 2 -5, 25);
    
    
    self.interested.frame = CGRectMake(11 + self.frame.size.width/ 5 * 2, 0, self.frame.size.width / 6, 25);
    
    
    
    self.collection.frame = CGRectMake(10 + self.frame.size.width / 5 * 4, 0, self.frame.size.width / 5 - 20, 25);
    
    
    self.inter.frame = CGRectMake(self.frame.size.width / 5 * 3, 0, self.frame.size.width/ 5, 25);
    
    self.cellView.frame = CGRectMake(0, _collection.frame.size.height, self.frame.size.width, 20);
   
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
